#include "ThreadPool.h"
#include "Task.h"
#include <memory>
using namespace ThreadPoolMoudle;

int main()
{
    // ENABLE_CONSOLE_LOG();
    // ENABLE_FILE_LOG();
    // std::unique_ptr<ThreadPool<task_t>> tp = std::make_unique<ThreadPool<task_t>>();
    // tp->Start();

    // int n = 10;
    // while (n--)
    // {
    //     tp->Equeue(push);
    //     sleep(1);
    // }
    // tp->Stop();
    // sleep(3);
    // tp->Wait();
    // return 0;

    ENABLE_CONSOLE_LOG();
    ThreadPool<task_t>::GetInstance()->Start();
    int cnt = 5;
    while (cnt--)
    {
        ThreadPool<task_t>::GetInstance()->Equeue(push);
        sleep(1);
    }
    ThreadPool<task_t>::GetInstance()->Stop();
    ThreadPool<task_t>::GetInstance()->Wait();
    return 0;
}